<!-- 结果说明 -->
<template>
	<view >
		<view class="list">
			<heads :text="resultText3" :imgUrl="imgUr"></heads>
			<view class="listTme">
				<text>{{text1}}</text>
				<text class="text2">{{text2}}</text>
				<text>{{text3}}{{text4}}</text>
				<text class="text2">{{text5}}</text>
				<text>{{text6}}</text>
			</view>

			<!-- 	<view class="listTexts">调理建议 </view>
			<block v-for="(item,index) in dataList" :key="index">
				<view class="bgItem">
					<image src="../static/img/img.png" mode="aspectFit" class="topImg" v-if="item.title=='饮食'"></image>
					<image src="../static/img/img2.png" mode="aspectFit" class="topImg" v-if="item.title=='生活'"></image>
					<view class="topkongs"></view>
					<block v-for="(i,ts) in item.list" :key="ts">
						<view class="contens_1 dis dis2 ">
							<text class="texts1">{{i.text}}</text>
							<text class="bgTexts">{{i.listtitle}}</text>
						</view>
					</block>
					
				</view>
			</block>
			 -->
			<view class="kongs">

			</view>
		</view>
		<!-- 作死行为 -->
		<view class="update" v-if="actionlist.length>0">
			<view class="headerTop dis dis2">
				<image src="../static/stiati/icon.png" mode="aspectFit" class="icon"></image>
				<text class="texts1">请记住你的作死行为</text>
				<image src="../static/image/sanjiao.png" mode="aspectFit" class="sanjiao"></image>
				<text class="texts2">（别说我没告诉你）</text>
			</view>
			<view class="itemsList dis dis6">
				<block v-for="(item,index) in actionlist" :key="index">
					<view class="udItems contenr">{{item}}</view>
				</block>

			</view>

		</view>
		<!-- 食谱推荐 -->
		<view class="recipe">
			<heads :text="recipe" :imgUrl="recipeimgUr"></heads>
			<view class="recipeTexts">
				<block v-for="(item,index) in list1" :key="index">
					<text class="titletext">{{item.text}}：</text>
					<text class="titletext2">{{item.listtitle}}</text>
				</block>
			</view>
		</view>
		<!-- 穴位调理 -->
		<view class="acupoint">
			<heads :text="acupoint" :imgUrl="acupointimgUr"></heads>
			<view class="acupointList">
				<view class="item dis " v-for="(item,index) in list2" :key="index">
					<text class="acupointtext1">{{item.text}}：</text>
					<text class="acupointtext2">{{item.listtitle}}</text>
				</view>

			</view>
		</view>
		<!-- 商品 -->
		<view class="commodity">
			<view class="toks">
				<view class="tops">
					<view class="kongs"></view>
					<view class="texts">What？上面的内容什么鬼？别着急，你也可以这样吃！</view>
				</view>
				<view class="textsList dis dis2">专属推荐</view>
				<view class="contes contenr">
					<view class="listCon dis dis3">
						<view class="left">
							<image :src="consumelist[0].pic" mode="aspectFit"></image>
						</view>
						<view class="rigth">
							<view class="kongs"></view>
							<view class="rigthTx">{{consumelist[0].title}}</view>
							<view class="rigthTx2">{{consumelist[0].subtitle}}</view>
							<view class="rmbs">
								<text class="rmbCon">¥</text>
								<text class="rmbCons">{{consumelist[0].price}}</text>
							</view>
						</view>
					</view>
				</view>
				<view class="toksbotms">更多症型推荐</view>
				<view class="botmsList">
					<scroll-view scroll-x="true" style="width: 100%;height: 100%;display: inline-block; ">
						<block  v-for="(items,index2) in consumelist" :key="index2">
						<view class="item1" v-if="index2>0">
							<view class="items_1 dis dis3">
								<view class="left">
									<image :src="items.pic" mode="aspectFill"></image>
								</view>
								<view class="rigths">
									<view class="kongs"></view>
									<view class="tigthText">{{items.subtitle}}</view>
									<view class="tigthrmb">¥{{items.price}}</view>
								</view>
							</view>
						</view>
						</block>
					</scroll-view>
				</view>
			</view>
			<view class="botm dis dis1 dis2 dis5" @click="topicpreview">
				<image :src="gzhpic" mode="aspectFit" class="imgs"></image>
				<image src="../static/img/shouz.png" mode="aspectFit" class="imgs_1"></image>
				<text class="text1">公众号可以购买商品哦~</text>
				<!-- <view v-if="isWeb">
					<web-view :src="urls"></web-view>
				</view> -->
				
				
			</view>

		</view>
		<view class="bottom dis dis2" v-if="inflamed==1 && indexRules ==0">
			<view class="botmoLeft">
				更多的调理建议，需结合综合症状自检给出，快去自测吧~
			</view>
			<view class="btns dis dis1 dis2" @click="goEveryDay">
				<text>健康自测 ></text>
				<!-- <text class="lefts">></text> -->
			</view>
			<!-- <image src="../static/img/img1.png" mode="aspectFit" class="btns"></image> v-if="inflamed==1"-->
		</view>
		<view class="bottom_1 dis dis2 dis1"  @click="goTijin"  v-if="inflamed==1">一键返回体检报告</view>
	</view>

</template>

<script>
	let app = getApp().globalData;
	import getRutdata from '@/common/js/indexFx.js';
	import heads from '@/components/head.vue';
	export default {
		props: {
			text1: {
				type: String
			},
			text2: {
				type: String
			},
			text3: {
				type: String
			},
			text4: {
				type: String
			},
			text5: {
				type: String
			},
			text6: {
				type: String
			},
			// text7: {
			// 	type: String
			// },
			// text8: {
			// 	type: String
			// },
			pindex: {
				type: Number,
				/*
					pindex:0，肥胖、情绪等；
							1，体质，
							
				*/
			}
		},
		components: {
			heads
		},
		data() {
			return {
				resultText3: '测评结果说明',
				imgUr: '/static/stiati/icon_1.png',
				text7: '',
				text8: '',
				dataList: [],
				recipe: '食谱推荐',
				recipeimgUr: '/static/stiati/icon_4.png',
				acupoint: '穴位调理',
				acupointimgUr: '/static/stiati/icon_5.png',
				list1: [], //食谱推荐
				list2: [], //穴位调理
				actionlist: [], //作死行为
				consumelist:[],//商品
				gzhpic:'',//公众号图片
				isWeb:false,
				urls:`https://weidian.com/?userid=1060673350&wfr=c&sfr=app&source=shop`,
				inflamed:app.inflamed,
				indexRules:app.indexRults,
			};
		},
		created() {
			let resultData = app.resultData;
			let jianyi = resultData.jianyi;
			this.actionlist = resultData.actionlist;
			let consumelist = resultData.consumelist
			this.consumelist = consumelist;
			this.gzhpic = resultData.gzhpic;
			console.log(this.actionlist)
			console.log(consumelist)
			if (!jianyi) {
				return
			}
			let data = [];

			for (let i in jianyi) {
				let list = []
				for (let j in jianyi[i]) {
					list.push({
						text: j,
						listtitle: jianyi[i][j]
					})
				}
				data.push({
					title: i,
					list: list
				})
			}
			let list1 = null;
			let list2 = null;
			for (let p = 0; p < data.length; p++) {
				if (data[p].title.indexOf('食谱') != -1) {
					list1 = data[p].list;
				} else if (data[p].title.indexOf('经穴') != -1) {
					list2 = data[p].list;
				} else {
					return
				}
			}
			console.log('list1', list1);
			console.log('list2', list2)
			this.dataList = data;
			this.list1 = list1;
			this.list2 = list2;
			console.log(data)
		},
		methods: {
			goEveryDay() {
				console.log('sssss')
				uni.redirectTo({
					url: '/second/me/everyday/everyday'
				})
			},
			topicpreview(){
				let url =this.gzhpic
				console.log('ssss',url)
				let previewImagUrl =[url];
				this.isWeb=true;
				uni.previewImage({
					current:url,
					urls:previewImagUrl
				})
				 uni.getImageInfo({// 获取图片信息（此处可不要）
				      src: url,
				      success: function (res) {
						  console.log(res)
				        console.log(res.width)
				        console.log(res.height)
				      }
				    })
			},
			goTijin(){
				getRutdata.everyday().then(res => {
					if (res.data.issuccess == 1) {
						let {
							data
						} = res.data;
						app.progresstext = data.age
						app.progresstext1 = data.score_zhf
						app.retuData = data;
						if (data.age == -1) {
							app.progresstext = '?'
						}
						if (data.score_zhf == -1) {
							app.progresstext1 = '?'
						}
						let list = data.weidulist;
						let listpo = [];
						let values = [];
						for (let i = 0; i < list.length; i++) {
							let num = (list[i].score).toFixed(0);
							let name = `${list[i].weidu}\n${num}`;
							if (list[i].weidu == '上火' && list[i].isempty == 1) {
								name = `${list[i].weidu}\n？`;
							}
							listpo.push({
								name,
								max: 100
							});
							values.push(list[i].score)
						}
						app.listRadar1 = listpo;
						app.value1 = values;
						uni.redirectTo({
							url: `/second/me/everydayResult/everydayResult`
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "../common/css/flex.css";
	@import "../common/css/index.scss";

	.list {
		width: 686upx;
		min-height: 200upx;
		background: #FFFFFF;
		border-radius: 24upx;
		margin: 30upx auto;

		.listTme {
			font-size: 28upx;
			font-family: $typeface1;
			font-weight: 400;
			color: #666666;
			width: 612upx;
			margin-left: 32upx;
			margin-bottom: 32upx;

			.text2 {
				color: #4693FF;
				font-family: $typeface;
			}
		}

		.listTexts {
			margin: 16upx auto 24upx auto;
			width: 612upx;
			font-size: 28upx;
			font-family: $typeface;
			font-weight: 500;
			color: #333333;
		}

		.kongs {
			width: 100%;
			height: 10upx;
		}
	}

	.bottom {
		width: 686upx;
		height: 130upx;
		background: #FFFFFF;
		border-radius: 24upx;
		margin: auto;

		.botmoLeft {
			width: 420upx;
			margin-left: 32upx;
			font-size: 26upx;
			font-family: $typeface1;
			font-weight: 500;
			color: #333333;
		}

		.btns {
			width: 174upx;
			height: 56upx;
			background: #FFD344;
			border-radius: 48upx;
			margin-left: 26upx;
			font-size: 26upx;
			font-family: $typeface;
			font-weight: 500;
			color: #333333;
			// .lefts{
			// 	width: 12upx ;
			// 	height: 12upx;
			// }
		}
	}

	.bgItem {
		background-image: url(../static/img/imgs.png);
		background-size: 100% 100%;
		width: 622upx;
		min-height: 188upx;
		border-radius: 10upx;
		margin: auto;
		position: relative;
		margin-bottom: 32upx;

		.topkongs {
			width: 100%;
			height: 40upx;
			// border: 1px solid red;
		}

		.topImg {
			width: 124upx;
			height: 40upx;
			position: absolute;
			top: 0;
			left: 0;
		}

		.contens_1 {
			width: 90%;
			min-height: 40upx;
			margin: 16upx 0;
			margin-left: 32upx;

			.texts1 {
				font-size: 28upx;
				font-family: $typeface;
				font-weight: 400;
				color: #333;
				margin-left: 33upx;
				margin-right: 10upx;
				padding-bottom: 20rpx;
			}

			.bgTexts {
				font-size: 28upx;
				font-family: $typeface1;
				font-weight: 400;
				color: #837364;
				margin-left: 33upx;
				margin-right: 10upx;
				padding-bottom: 20rpx;
			}
		}
	}

	.update {
		width: 686upx;
		min-height: 145upx;
		background: #FFFFFF;
		border-radius: 24upx;
		margin: auto;
		margin-bottom: 32upx;

		// padding-bottom: 30upx;
		.headerTop {
			width: 100%;
			height: 114upx;

			.icon {
				width: 44upx;
				height: 44upx;
				margin-left: 32upx;
				margin-right: 11upx;
			}

			.texts1 {
				height: 50upx;
				font-size: 36upx;
				font-family: $typeface;
				font-weight: 500;
				color: #333333;
				margin-right: 5upx;
			}

			.sanjiao {
				width: 17upx;
				height: 17upx;
				// margin-right: 16upx;
			}

			.texts2 {

				height: 37upx;
				font-size: 26upx;
				font-family: $typeface1;
				font-weight: 400;
				color: #999999;
			}
		}

		.itemsList {
			width: 622upx;
			margin: auto;
			padding-bottom: 36upx;

			.udItems {
				// min-width: 168upx;
				height: 56upx;
				background: #333333;
				border-radius: 28upx;
				font-size: 26upx;
				font-family: $typeface;
				font-weight: 400;
				color: #FFFFFF;
				margin-right: 20upx;
				margin-bottom: 20upx;
				padding: 0 25upx;
			}
		}

	}

	.recipe {
		width: 686upx;
		min-height: 338upx;
		background: #FFFFFF;
		border-radius: 24upx;
		margin: auto;
		margin-bottom: 32upx;
		padding-bottom: 56upx;

		.recipeTexts {
			width: 614upx;
			min-height: 160upx;
			font-size: 28upx;
			margin: auto;

			// font-family: PingFangSC-Medium, PingFang SC;
			// font-weight: 500;
			// color: #333333;
			.titletext {
				font-family: $typeface;
				font-weight: 500;
				color: #333333;
			}

			.titletext2 {
				color: #666666;
				font-family: $typeface1;
			}
		}

	}

	.acupoint {
		width: 686upx;
		min-height: 276upx;
		background: #FFFFFF;
		border-radius: 24upx;
		margin: auto;
		margin-bottom: 32upx;
		padding-bottom: 5upx;

		.acupointList {
			width: 622upx;
			margin: auto;
		}

		.item {
			width: 100%;
			min-height: 40upx;
			margin-bottom: 18upx;

			.acupointtext1 {
				font-size: 28upx;
				font-family: $typeface;
				font-weight: 500;
				color: #333333;
				width: 15%;
				// border: 1px solid red;
			}

			.acupointtext2 {
				width: 85%;
				font-size: 28upx;
				font-weight: 400;
				color: #666666;
				font-family: $typeface1;
			}
		}
	}

	.commodity {
		width: 686upx;
		height: 1242upx;
		background-image: url(../static/img/bgsto1.png);
		background-size: 100% 100%;
		margin: auto;
		margin-bottom: 32upx;

		.toks {
			width: 624upx;
			height: 957upx;
			border-bottom: 1px dashed #EAEAEA;
			margin: auto;

			.tops {
				width: 100%;
				height: 120upx;

				.kongs {
					width: 100%;
					height: 40upx;
				}

				.texts {
					width: 100%;
					height: 80upx;
					font-size: 28upx;
					font-family: $typeface;
					font-weight: 500;
					color: #4693FF;
				}
			}

			.textsList {
				width: 100%;
				height: 42upx;
				font-size: 30upx;
				font-family: $typeface;
				font-weight: 500;
				color: #333333;
				margin-top: 40upx;
			}

			.contes {
				width: 622upx;
				height: 413upx;
				background: #FFFFFF;
				box-shadow: 0px 4upx 24upx 0px rgba(0, 0, 0, 0.1);
				border-radius: 40upx;
				margin: auto;
				margin-top: 20upx;

				.listCon {
					width: 574upx;
					height: 360upx;
					background: #F8F8F8;
					border-radius: 24upx;

					.left {
						width: 360upx;
						height: 360upx;

						image {
							width: 100%;
							height: 100%;
							border-radius: 24upx 0 0 24upx;
						}
					}

					.rigth {
						width: 198upx;
						height: 360upx;

						.kongs {
							width: 100%;
							height: 86upx;
						}

						.rigthTx {
							height: 50upx;
							font-size: 36upx;
							font-family: $typeface;
							font-weight: 500;
							color: #333333;
						}

						.rigthTx2 {
							height: 37upx;
							font-size: 26upx;
							font-family: $typeface1;
							font-weight: 400;
							color: #999999;
						}

						.rmbs {
							width: 100%;
							height: 73px;
							margin-top: 27upx;

							.rmbCon {
								font-size: 32upx;
								font-family: $typeface;
								font-weight: 500;
								color: #E85335;
							}

							.rmbCons {
								font-size: 52upx;
								font-family: $typeface;
								font-weight: 500;
								color: #E85335;
							}
						}
					}
				}
			}

			.toksbotms {
				width: 100%;
				height: 42upx;
				font-size: 30upx;
				font-family: $typeface;
				font-weight: 500;
				color: #333333;
				margin-top: 56upx;
			}

			.botmsList {
				width:654upx;
				height: 130upx;
				margin-top: 24upx;
				margin-bottom: 70upx;

				scroll-view {
					width: 100%;
					height: 100%;
					white-space: nowrap;

					.item1 {
						display: inline-block;
						width: 284upx;
						height: 130upx;
						margin-right: 10upx;
						.items_1{
							width: 284upx;
							height: 130upx;
							// border: 1px solid red;
							.left{
								width: 130upx;
								height: 130upx;
								image{
									width: 100%;
									height: 100%;
									border-radius: 8upx;
								}
							}
							.rigths{
								width: 146upx;
								height: 100%;
								.kongs{
									width: 100%;
									height: 15upx;
								}
								.tigthText{
									
									height: 37upx;
									font-size: 26upx;
									font-family: $typeface;
									font-weight: 500;
									color: #333333;
								}
								.tigthrmb{
									margin-top: 34upx;
									height: 37upx;
									font-size: 26upx;
									font-family: $typeface;
									font-weight: 500;
									color: #E85335;
								}
							}
						}
					}
				}
			}
		}
		.botm{
			width: 100%;
			height: 231upx;
			margin-top: 24upx;
			.imgs{
				width: 146upx;
				height: 147upx;
			}
			.imgs_1{
				width: 32upx;
				height: 41upx;
				margin: 5upx 0 0 0;
			}
			.text1{
				height: 37upx;
				font-size: 26upx;
				font-family: $typeface;
				font-weight: 500;
				color: #333333;
			}
		}

	}
	.bottom_1{
		width: 684upx;
		height: 88upx;
		background: #FFD344;
		border-radius: 44upx;
		margin: auto;
		font-size: 32upx;
		font-family: PingFangSC-Medium, PingFang SC;
		box-shadow: 0px 9upx 25upx 0px #FFE07A;
		font-weight: 500;
		color: #333333;
		margin-top: 30rpx;
	}
</style>
